﻿<%@ page language="java" import="java.util.*,cn.ac.cintcm.dataconverge.researchsubject.domain.*" pageEncoding="UTF-8"%>
<%@page import="com.hs.core.page.PageUtil,com.hs.core.utils.*"%>
<%@page import="cn.ac.cintcm.dataconverge.util.Constants;"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
PageUtil pageUtil = (PageUtil)request.getAttribute("finishauditlist");
List resultList = null;
String pageStr = ""; 
int perpageCount = 1;
int currentPage = 1;
if(null != pageUtil){
   resultList = pageUtil.getPageList();
   pageStr = pageUtil.getPageStr();
   perpageCount = pageUtil.getNumberPerPage();
   currentPage = pageUtil.getCurrentPage();
}
String subjectname = (String)request.getAttribute("subjectname");
String startdate = (String)request.getAttribute("startdate");
String enddate = (String)request.getAttribute("enddate");
String orderName = (String)request.getAttribute("orderName");
String orderNum = (String)request.getAttribute("orderNum"); 

String status = (String)request.getAttribute("status");


%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
    <title>课题信息</title>
    <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
    <link href="<%=path%>/index/Themes/com/style.css" rel="stylesheet" type="text/css" /> 
    <script src="<%=path%>/index/Scripts/Script.js" language="javascript" type="text/javascript"></script>
     <script src="<%=path%>/js/common.js" language="javascript" type="text/javascript"></script>
    <script language="javascript" type="text/javascript" src="<%=path %>/js/My97DatePicker/WdatePicker.js"></script>
    <script language="javascript" type="text/javascript">
       function delSubject(id){
       		if(null != id && id != '' ){
       		 	if(confirm("确认删除课题?")){
       		 		form1.action = '<%=path%>/subjectToAdd.htm?action=delSubject&id='+id;
       		 		form1.submit();
       		 	}
       		}
       
       }
       function searchSubject(){ 
       	
       			searchform.submit();			
       }
    </script>

</head>
<body class="rtm_body" scroll=yes>
<form name="searchform" action = "<%=path%>/checkManage.htm?action=listAuditExpertList" method="post">
    <div class="r_rtm_tb_mg1">
        <div class="r_rtm_tb1">
            <span>
                <img src="<%=path%>/index/Themes/com/idt_tb_pass.gif" />&nbsp;&nbsp;已评审课题列表</span>
        </div>
    </div>   
     <table cellspacing="2" cellpadding="0" width="100%" class="idt_item_mg" id="Table2">
       <tr>
            <td class="fim_l">
                课题名称：</td>
            <td class="fim_r">
                <input type="text" name="subjectname" value="<%=subjectname==null?"":subjectname %>" class="com_textbox" ></td>
           <!-- <td class="fim_l">
                申报日期：</td>
            <td class="fim_r" nowrap width="30%">
                从
               <input type="text" class="Wdate" id="startdate" value="<%=startdate==null?"":startdate %>" style="width:40%" name="startdate"  onFocus="WdatePicker({el:'startdate',dateFmt:'yyyy-MM-dd'})" />
                &nbsp;至
               <input type="text" class="Wdate" id="enddate" value="<%=enddate==null?"":enddate %>" style="width:40%" name="enddate"  onFocus="WdatePicker({el:'enddate',dateFmt:'yyyy-MM-dd'})" />
            </td>-->
             <td class="fim_l">
                课题状态：</td>
            <td class="fim_r" nowrap width="30%">
               <select name="status" style="width:100%">
                 <option value="-1">----请选择----</option>
                 <option value="<%=Constants.subject_state_save%>" <%if((""+Constants.subject_state_save).equals(status)){out.println(" selected");} %>>未提交审批</option>
                 <option value="<%=Constants.subject_state_apply%>" <%if((""+Constants.subject_state_apply).equals(status)){out.println(" selected");} %>>申报中</option>
                  <option value="<%=Constants.subject_state_advised%>" <%if((""+Constants.subject_state_advised).equals(status)){out.println(" selected");} %>>推荐中标</option>
                   <option value="<%=Constants.subject_state_checked%>" <%if((""+Constants.subject_state_checked).equals(status)){out.println(" selected");} %>>中标</option>
                  <option value="<%=Constants.subject_state_researching%>" <%if((""+Constants.subject_state_researching).equals(status)){out.println(" selected");} %>>在研</option>
                 <option value="<%=Constants.subject_state_endApply%>" <%if((""+Constants.subject_state_endApply).equals(status)){out.println(" selected");} %>>申请结题</option>
                
                   <option value="<%=Constants.subject_state_ended%>" <%if((""+Constants.subject_state_ended).equals(status)){out.println(" selected");} %>>已结题</option>
                   <option value="<%=Constants.subject_state_unchecked%>" <%if((""+Constants.subject_state_unchecked).equals(status)){out.println(" selected");} %>>未中标</option>
                   <option value="<%=Constants.subject_state_retuen%>" <%if((""+Constants.subject_state_retuen).equals(status)){out.println(" selected");} %>>退回修改</option>
                 
                </select>  
            </td>
            <td class="fim_r" align="right" colspan="2">
                <input type="button" value="查询"  onclick="searchSubject()" class="com_btn2" id="Button5">
            </td>
        </tr> 
        </form>
    </table> 
   
    <table cellpadding="0" cellspacing="0" border="0" width="100%">
        <tr>
            <td>
                <div class="content">
                 <form name="form1" action="" method="post">
                    <table width="*" cellpadding="0" cellspacing="1" class="dg_borderstyle" id="Table4">
                        <tr>
                            <td class="dg_headerstyle">
                                序号</td> 
                            <td class="dg_headerstyle" width="20%">
                                <a href="javaScript:orderPage('subjectname','<%=OrderTool.getOrderNum("subjectname",orderName,orderNum)%>');">课题名称&nbsp;&nbsp;<%=OrderTool.getOrderImage(basePath,OrderTool.getOrderNum("subjectname",orderName,orderNum))%></a></td>
                            <td class="dg_headerstyle" width="10%">
                                 <a href="javaScript:orderPage('state','<%=OrderTool.getOrderNum("state",orderName,orderNum)%>');">当前状态&nbsp;&nbsp;<%=OrderTool.getOrderImage(basePath,OrderTool.getOrderNum("state",orderName,orderNum))%></a></td>
                                 <td class="dg_headerstyle" >
                                负责人</td>
                                  <td class="dg_headerstyle">
                                课题来源</td>
                                <td class="dg_headerstyle" width="10%">
                                 <a href="javaScript:orderPage('startdate','<%=OrderTool.getOrderNum("startdate",orderName,orderNum)%>');">计划开始日期&nbsp;&nbsp;<%=OrderTool.getOrderImage(basePath,OrderTool.getOrderNum("startdate",orderName,orderNum))%></a></td> 
                                 <td class="dg_headerstyle">
                                评审状态</td> 
                              <td class="dg_headerstyle"  >
                                <a href="javaScript:orderPage('syntype','<%=OrderTool.getOrderNum("syntype",orderName,orderNum)%>');">评审类别&nbsp;&nbsp;<%=OrderTool.getOrderImage(basePath,OrderTool.getOrderNum("syntype",orderName,orderNum))%></a></td> 
                                <td class="dg_headerstyle">
                                评审结果</td>
                                
                          <td class="dg_headerstyle"  >
                                <a href="javaScript:orderPage('startDate','<%=OrderTool.getOrderNum("startDate",orderName,orderNum)%>');">评审开始日期&nbsp;&nbsp;<%=OrderTool.getOrderImage(basePath,OrderTool.getOrderNum("startDate",orderName,orderNum))%></a></td> 
                                   <td class="dg_headerstyle"  >
                                <a href="javaScript:orderPage('endDate','<%=OrderTool.getOrderNum("endDate",orderName,orderNum)%>');">评审完成日期&nbsp;&nbsp;<%=OrderTool.getOrderImage(basePath,OrderTool.getOrderNum("endDate",orderName,orderNum))%></a></td>   
                                <td class="dg_headerstyle">
                                评审意见</td>
                             
                        </tr>
                        <%if(null != resultList && resultList.size()> 0){
                            for(int i = 0;i < resultList.size();i++){
                            	ResmanSubjectExpert obj = (ResmanSubjectExpert)resultList.get(i); 
                         %>
                        <tr class="dg_alternatingitemstyle" onmouseover="ChangeRowBg(this);" onmouseout="ChangeRowBg(this);" onmouseup="ChangeRowBg(this);" onmousedown="ChangeRowBg(this);">
                            <td align="center"><%= perpageCount*(currentPage-1)+i+1 %></td> 
                            <td>
                                 <a href="#"   onclick="openwindow('<%=path %>/subjectToAdd.htm?action=viewSubject&id=<%=obj.getSubject().getId() %>','','','')"> <%=StringUtilTool.NULL2Blank(obj.getSubject().getSubjectname()) %></a>
                            </td>
                            <td align="center">
                                <font color="red"><%=Constants.getSubjectStatus(obj.getSubject().getState()) %></font>
                            </td> 
                            <td>
                               <%
                                 if(obj!=null&&obj.getSubject()!=null){
                                 Subject subjectObj = obj.getSubject();
                                   if(subjectObj != null){
                                     Set res = subjectObj.getSubRes();
                                     Iterator it = res.iterator();
                                     int j = 0;
                                     while(it.hasNext()){
                                    	
                                         SubRes rearcher = (SubRes)it.next();
                                         if(Constants.researcher_role_chargeman.equals(rearcher.getResRole()+"")){
                                        	 j++;
                                        	 out.println(rearcher.getRes()==null?"":rearcher.getRes().getName()+"&nbsp;"); 
                                         }
                                        // if(j>1)
                                        //	 out.println(",");
                                     }
                                   } 
                                 }
                                 %></td>
                            <td>
                                 <%
                                   if(obj != null){
                                     Set tags = obj.getSubject().getTags();
                                     Iterator ittag = tags.iterator();
                                     while(ittag.hasNext()){
                                    	 SubTag tag = (SubTag)ittag.next();
                                         if(null != tag && tag.getTag() != null && tag.getTag().getTagType() == 1)
                                         	out.println( tag.getTag().getName());
                                     }
                                   } 
                                 %>
                            </td>
                            <td align="center" width="5%">
                                <%=Tools.getDateStringByDate1(obj.getSubject().getStartdate()) %>
                              
                            </td>
                            <td align="center">
                                 <%
                                 Long statusObj = obj.getAuditstatus();
                                 if(null != statusObj&&1 == statusObj.intValue())
                                    out.println("已评审");
                                 
                                 %>
                            </td> 
                            <td align="center">
                                 <%=obj.getSyntype()
                                 %>
                            </td> 
                            <td align="center">
                                 <%
                                 String result = obj.getExpertResult();
                                 if("1".equals(result))
                                     out.println("不通过");
                                  if("2".equals(result))
                                      out.println("通过"); 
                                 %>
                            </td> 
                            
                            <td align="center">
                                <%=Tools.getDateStringByDate1(obj.getStartDate()) %>
                            </td>
                            <td align="center">
                                <%=Tools.getDateStringByDate1(obj.getEndDate()) %>
                            </td> 
                            
                            <td align="center">
                                <img src="<%=path %>/index/Themes/com/user3_(edit)_16x16.gif" style="cursor:hand" alt="评审" onclick="javaScript:openwindow('<%=path %>/checkManage.htm?action=expertSubject&expertid=<%=obj.getId() %>&isview=true','800','600','')"/> 
                            </td> 
                        </tr> 
                        <%}}else{%>
                         <tr class="dg_alternatingitemstyle"> 
                            <td align="center" colspan=14>
                                <font color="red">没有找到记录</font>
                            </td> 
                        </tr> 
                        <%}%>
                    </table>
                    </form>
                    <div class="dg_pagerstyle" align="right"> 
                            <%=pageStr %>  
                    </div> 
                </div>
            </td>
        </tr>
    </table>
</body>
</html>
